<template>
  <div class="newsinfo">
    <header>
      <h1 class="title">
        {{newsinfo.title}}
      </h1>
      <div class="des">
        <span class="ctime">{{newsinfo.add_time}}</span>
        <span class="click">点击{{newsinfo.click}}</span>
      </div>
    </header>
    <div class="content">
      {{newsinfo.content}}
    </div>
  </div>
</template>
<script>
export default {
  data: () => ({
    id: '',
    newsinfo: {}
  }),
  created() {
    this.id = this.$route.params.id
    this.getInfo()
  },
  methods: {
    async getInfo() {
      try {
        const { data: { message } } = await this.Api.getInfo(this.id)
        this.newsinfo = message
        // console.log(this.newsinfo)
      } catch (error) {
        this.$Toast('新闻列表请求失败。。。' + error.message)
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.newsinfo {
  .title{
    font-size: 17px;
    text-align: center;
  }
}
</style>
